<?php
namespace User\Controller;
use Common\Controller\MemberbaseController;
class FanxianController extends MemberbaseController {
	
	
	protected $db;
	function _initialize(){
		parent::_initialize();
		$this->db=M("OrderFenzhang");
		$this->assign ( "seo_title",  "返现" );
	}

	
	function index(){


		$this->assign ( "nav", "fanxian" );

			$map [uid] = $this->u[id];








		$sum= $this->db->where ( $map )->order ("id desc" )->sum ("money");


		$count = $this->db->where ( $map )->count ();
		$page = $this->page ( $count, 20 );
		$list = $this->db->where ( $map )->order ("id desc" )->limit ( $page->firstRow . ',' . $page->listRows )->select ();







		     $this->assign("sum",$sum);

		$this->assign ( "Page", $page->show ( 'Admin' ) );
		$this->assign ( "_list", $list );

			$this->display ();








	}

}